Fix Save Options Issue with new characters #68
Merged
+9
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Save options was keeping values from a previously loaded character whenever a new character was started. The WillowSaveGameManager:EndLoadGame hook I was using never gets called on a new character, so setting the defaults gets skipped. This PR just changes the hook to WillowGame.WillowPlayerController:FinishSaveGameLoad, which gets called for both existing character loads and new character loads.
Also changed to a pre-hook because it appears that there are some cases that a character can be loaded into a map during this new function call, triggering our on_load callbacks. The callbacks would be useless if they occur before the save option values are loaded.
I tested on AnarchySaver and WeaponProficiencies, and both appear to work well with the change.